import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int count =0;
        while(n!=0){
            n=n&(n-1);
            count++;
        }
        System.out.println(count);
    }

    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int i=scanner.nextInt();
        int j=scanner.nextInt();
        if(i>j){
            int tmp=i;
            i=j;
            j=tmp;
        }
        int max=1;
        for(int a=1;a<=i;a++){
            if(i%a==0 && j%a==0){
                max=a;
            }
        }
        System.out.println(max);
    }
    public static void main5(String[] args) {
        float i =1;
        float j=0;
        float sum=0;
        for(j=1;j<=100;j++){
            sum+=i/j;
            i=-i;
        }
        System.out.println(sum);
    }
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();
        int i=0;

        for(i=0;i<=n;i++){
            int sum=0;
            int a=i;
            for(int j=0;j<3;j++){
                sum+=(a%10)*(a%10)*(a%10);
                a/=10;
            }
            if(sum==i){
                System.out.print(i+" ");
            }
        }
    }
    public static void main3(String[] args) {
        int i=0;
        int j=0;
        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();

        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if( i==j || i==n-1-j){
                    System.out.print("*");
                }else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();
        int i=0;

        for(i=2;i<n;i++){
            if(n%i==0){
                System.out.println("不是素数");
                break;
            }
        }
        if(i==n){
            System.out.println("是素数");
        }
    }
    public static void main1(String[] args) {
        int i=1;
        int count=0;
        for(i=1;i<=100;i++){
            if(i%10==9 || i/10==9){
                count++;
            }
        }
        System.out.println(count);
    }
}
